import {rolelist} from '../../../request/api'
const state = {
    rolelist:[]
}
const getters = {
    getRole(state){
        return state.rolelist
    }
}

const mutations = {
    REQ_LIST(state,payLoad){
        state.rolelist = payLoad
    }
}

const actions = {
    getRoleActions({commit}){
        rolelist()
        .then(res=>{
            console.log(res,'行动')
            if(res.code==200){
                commit('REQ_LIST',res.list?res.list : [])
            }
        })
    }
}

export default {
    state,
    getters,
    actions,
    mutations,
    namespaced:true
}